<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>学生成绩管理系统</title>
    <style>
        body {
            font-family: 'Microsoft YaHei', sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f5f5f5;
        }

        .header {
            background-color: #2c3e50;
            color: white;
            padding: 1rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .header h1 {
            margin: 0;
            font-size: 1.5rem;
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .user-info span {
            color: #ecf0f1;
        }

        .container {
            display: flex;
            min-height: calc(100vh - 60px);
        }

        .sidebar {
            width: 200px;
            background-color: white;
            box-shadow: 2px 0 4px rgba(0,0,0,0.1);
            padding: 1rem 0;
        }

        .nav-list {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .nav-item {
            margin-bottom: 0.5rem;
        }

        .nav-item a {
            color: #2c3e50;
            text-decoration: none;
            padding: 0.8rem 1.5rem;
            display: block;
            transition: all 0.3s;
        }

        .nav-item a:hover {
            background-color: #f0f0f0;
            padding-left: 2rem;
        }

        .nav-item.active a {
            background-color: #3498db;
            color: white;
        }

        .main-content {
            flex: 1;
            padding: 2rem;
        }

        .dashboard-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }

        .card {
            background-color: white;
            border-radius: 8px;
            padding: 1.5rem;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .card-title {
            margin: 0 0 1rem 0;
            color: #2c3e50;
            font-size: 1.2rem;
        }

        .stat {
            font-size: 2rem;
            color: #3498db;
            margin: 1rem 0;
        }

        .btn {
            display: inline-block;
            background-color: #3498db;
            color: white;
            border: none;
            padding: 0.8rem 1.5rem;
            border-radius: 4px;
            cursor: pointer;
            text-decoration: none;
            transition: background-color 0.3s;
        }

        .btn:hover {
            background-color: #2980b9;
        }

        .btn-logout {
            background-color: #e74c3c;
        }

        .btn-logout:hover {
            background-color: #c0392b;
        }

        .actions-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1rem;
        }

        .btn-action {
            text-align: center;
            padding: 1.5rem;
            background-color: #f8f9fa;
            border-radius: 8px;
            transition: all 0.3s;
        }

        .btn-action:hover {
            background-color: #3498db;
            color: white;
            transform: translateY(-2px);
        }
    </style>
</head>
<body>
    <div class="header">
        <h1>学生成绩管理系统</h1>
        <div class="user-info">
            <span>欢迎, ${user.username}</span>
            <a href="logout" class="btn btn-logout">退出登录</a>
        </div>
    </div>

    <div class="container">
        <div class="sidebar">
            <ul class="nav-list">
                <li class="nav-item active"><a href="dashboard.jsp">首页</a></li>
                <li class="nav-item"><a href="student?action=list">学生管理</a></li>
                <li class="nav-item"><a href="grade?action=list">成绩管理</a></li>
                <li class="nav-item"><a href="changePassword">修改密码</a></li>
            </ul>
        </div>

        <div class="main-content">
            <div class="dashboard-grid">
                <div class="card">
                    <h3 class="card-title">学生总数</h3>
                    <div class="stat">150</div>
                    <a href="student?action=list" class="btn">查看详情</a>
                </div>
                <div class="card">
                    <h3 class="card-title">本月新增成绩</h3>
                    <div class="stat">28</div>
                    <a href="grade?action=list" class="btn">查看详情</a>
                </div>
                <div class="card">
                    <h3 class="card-title">平均成绩</h3>
                    <div class="stat">85.6</div>
                    <a href="grade?action=list" class="btn">查看详情</a>
                </div>
            </div>

            <div class="card">
                <h3 class="card-title">快速操作</h3>
                <div class="actions-grid">
                    <a href="student?action=add" class="btn-action">
                        <h4>添加学生</h4>
                        <p>录入新学生信息</p>
                    </a>
                    <a href="grade?action=add" class="btn-action">
                        <h4>录入成绩</h4>
                        <p>添加学生成绩</p>
                    </a>
                    <a href="student?action=list" class="btn-action">
                        <h4>学生列表</h4>
                        <p>管理所有学生</p>
                    </a>
                    <a href="grade?action=list" class="btn-action">
                        <h4>成绩列表</h4>
                        <p>查看所有成绩</p>
                    </a>
                </div>
            </div>
        </div>
    </div>
</body>
</html> 